package fauxman.PinkyStates;

import java.awt.Point;

import fauxman.DynamicElements.FauxMan;
import fauxman.DynamicElements.Ghost;
import fauxman.model.WorldModel;
import fauxman.utilities.ActionUtil;
import fauxman.utilities.SpriteUtil;

public class ChasePinkyState extends PinkyState {
	private static ChasePinkyState instance;
	
	private ChasePinkyState(){
	}
	
	public static ChasePinkyState getInstance(){
		if (instance==null)
			instance = new ChasePinkyState();
		return instance;
	}
	
	public void setAppearance(int appearanceID, Ghost g) {
		g.setAppearance(SpriteUtil.getPinkySprite(appearanceID));
	}

	public int[] getTarget(WorldModel model, Ghost g) {
		FauxMan fm = model.getFauxman();
		int[] target = new int [2];
		Point targetPoint = ActionUtil.getNextPosition(fm.getDiscretePosition(), 4, fm.getCurrentDirection()); //Pinky looks 4 units ahead of 
		target[0] = targetPoint.x;
		target[1] = targetPoint.y;
		return target;
	}
}
